package com.meilele.biz.hongdian;

import com.meilele.dao.hongdian.ThiCaseLableMapper;
import com.meilele.dao.hongdian.ThiCaseMapper;
import com.meilele.entity.hongdian.ThiCase;
import com.meilele.util.hongdian.Constant;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class ThiCaseBiz {

    @Resource
    private ThiCaseMapper thiCaseMapper;
    @Resource
    private ThiCaseLableMapper caseLableMapper;

    public List<ThiCase> findAllCase(int page){
        int firstPage = (page - 1) * Constant.PAGE_SIZE;
        return thiCaseMapper.findAllCase(firstPage,Constant.PAGE_SIZE);
    }
    public int findCount(){
        return thiCaseMapper.findCount();
    }

    public List<ThiCase> findAllLableCase(int page){
        int firstPage = (page - 1) * Constant.PAGE_SIZE;
        return thiCaseMapper.findAllLableCase(firstPage ,Constant.PAGE_SIZE);
    }

    public List<ThiCase> findAllLables(){
        return thiCaseMapper.findAllLables();
    }

    public List<ThiCase> findAllCaseDescPeople(int page){
        int firstPage = (page - 1) * Constant.PAGE_SIZE;
        return thiCaseMapper.findAllCaseDescPeople(firstPage , Constant.PAGE_SIZE);
    }

    public List<ThiCase> findCompany(String company){
        return thiCaseMapper.findCompany(company);
    }

    public int insertSelective(ThiCase thiCase){
        return thiCaseMapper.insertSelective(thiCase);
    }

}
